<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul{
            width:600px;
            margin: 50px auto;
            height:30px;
            list-style: none;
            background-color:goldenrod;
        }
        li{
            float:left;
            line-height: 30px;
            
            margin:0 16px;
        }
        .one{
          display: none;
        } 
        section{
        background-color:goldenrod;
        }
         section:hover{
            background-color:gold;
         }
        .clear{
        clear:both;
        }
        .five{
            display: none;
        }
    </style>
</head>

<body>
    <ul>
        <li>会员首页</li>
        <li class="two">看电影
            <section class="one">华语电影</section>
            <section class="one">海外大片</section>
        </li>
        <li class="four">看剧
            <section class="five">英剧</section>
            <section class="five">美剧</section>
            <section class="five">港剧</section>
            <section class="five">韩剧</section>
        </li>
        <li>看动漫</li>
        <li>纪录片</li>
        <li>德云社</li>
        <li>看直播</li>
        <div class="clear"></div> 
    </ul>
</body>
</html>
<script>
    var two = document.querySelectorAll(".two");
    var four = document.querySelectorAll(".four");
    var one = document.querySelectorAll('.one');
    var five =document.querySelectorAll('.five');
       for(var i=0;i<two.length;i++){
           two[0].onmouseover = function(){
               one[0].className="";
               one[1].className="";
           }
           two[0].onmouseout = function(){
               one[0].className="one";
               one[1].className="one";
       }
        for(var i=0;i<four.length;i++){
            four[0].onmouseover = function(){
                five[0].className=""
                five[1].className=""
                five[2].className=""
                five[3].className=""
                console.log(i);
            }
        
        for(var i=0;i<four.length;i++){
            four[0].onmouseout = function(){
                five[0].className="five"
                five[1].className="five"
                five[2].className="five"
                five[3].className="five"
                console.log(i);
            }
}
}
     }
</script>